/* Copyright (C) 2016-2017 HangZhou Zenzet Technology Co., Ltd.
 * All right reserved

 * File:lkterr.h
 * Author:guojianchuan
 * Date:2017-05-26

 */

#ifndef LKT_ERR_H_
#define LKT_ERR_H_

#ifdef __cplusplus
extern "C" {
#endif

/* Declare : Macro/Struct/Enum/Union/Function */

/* 公共模块 */
#define ERR_COMMON_SUCCESS                      0
#define ERR_COMMON_FAILED                       1
#define ERR_COMMON_INVALID_PARAM                2
#define ERR_COMMON_SYSFAILED                    3       /* 系统调用/libc/libc++函数调用 */
#define ERR_COMMON_NO_MEM                       4       /* 内存申请失败 */
#define ERR_COMMON_EMPTY_FILE                   5       

/* OpenSSL模块(openssl模块比较特殊, SUCCESS返回1) */
#define ERR_OPENSSL_SUCCESS                     1
#define ERR_OPENSSL_FAILED                      20
#define ERR_OPENSSL_INVALID_CIPHER              21
#define ERR_OPENSSL_INVALID_DIGEST              22
#define ERR_OPENSSL_CIPHER_INIT_FAILED          23
#define ERR_OPENSSL_CIPHER_UPDATE_FAILED        24
#define ERR_OPENSSL_CIPHER_FINAL_FAILED         25
#define ERR_OPENSSL_DIGEST_INIT_FAILED          26
#define ERR_OPENSSL_DIGEST_UPDATE_FAILED        27
#define ERR_OPENSSL_DIGEST_FINAL_FAILED         28
#define ERR_OPENSSL_DIGEST_NEW_MAC_KEY_FAILED   29
#define ERR_OPENSSL_DIGEST_SIGN_INIT_FAILED     30
#define ERR_OPENSSL_DIGEST_SIGN_UPDATE_FAILED   31
#define ERR_OPENSSL_DIGEST_SIGN_FINAL_FAILED    32
#define ERR_OPENSSL_CIPHER_D2I_PVKEY_FAILED     33
#define ERR_OPENSSL_CIPHER_RSA_NEWKEY_FAILED    34
#define ERR_OPENSSL_CIPHER_RSA_INIT_FAILED      35
#define ERR_OPENSSL_CIPHER_RSA_SET_PAD_FAILED   36
#define ERR_OPENSSL_CIPHER_RSA_DECRYPT_FAILED   37
#define ERR_OPENSSL_PBKDF2_FAILED               38

/* CURL模块 */
#define ERR_CURL_FAILED                         50
#define ERR_CURL_PERFORM_FAILED                 51

/*　SQL解析模块 */
#define ERR_SQLPARSER_FAILED                    100     /* SQLPARSER解析模块出错，都用这个错误码 */

/* MYSQL模块 */
#define ERR_MYSQL_FAILED                        150

/* 业务模块 */
#define ERR_VALIDATE_SERVER_FAILED              200     /* 验证服务器失败 */
#define ERR_JSON_PARSE_FAILED                   201
#define ERR_API_RESPONSE_FAILED                 202
#define ERR_TOO_MANY_STRATEGY                   203
#define ERR_INVALID_STRATEGY                    204
#define ERR_JSON_CREATE_FAILED                  205
#define ERR_INVALID_START_IDENTIFY              206
#define ERR_INVALID_END_IDENTIFY                207
#define ERR_INVALID_VERSION_IDENTIFY            208
#define ERR_INVALID_KEY_CRC                     209
#define ERR_INVALID_CIPHER_CRC                  210
#define ERR_NO_SHM                              211
#define ERR_CONVERT_FAILED                      212
#define ERR_DONT_NEED_ENCRYPT                   213
#define ERR_INVALID_APPKEY                      214
#define ERR_INVALID_APPDATAKEY                  215
#define ERR_INVALID_SQL                         216
#define ERR_INVALID_STRING                      217

#ifdef __cplusplus

}
#endif
#endif

